package com.ruoyi.equipment.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.equipment.domain.FzEquipment;
import com.ruoyi.equipment.mapper.FzEquipmentMapper;
import com.ruoyi.equipment.service.IFzEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 设备管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-03-22
 */
@Service
public class FzEquipmentServiceImpl implements IFzEquipmentService
{
    @Autowired
    private FzEquipmentMapper fzEquipmentMapper;

    /**
     * 查询设备管理
     * 
     * @param equipmentId 设备管理ID
     * @return 设备管理
     */
    @Override
    public FzEquipment selectFzEquipmentById(String equipmentId)
    {
        return fzEquipmentMapper.selectFzEquipmentById(equipmentId);
    }

    /**
     * 查询设备管理列表
     * 
     * @param fzEquipment 设备管理
     * @return 设备管理
     */
    @Override
    public List<FzEquipment> selectFzEquipmentList(FzEquipment fzEquipment)
    {
        return fzEquipmentMapper.selectFzEquipmentList(fzEquipment);
    }

    /**
     * 新增设备管理
     * 
     * @param fzEquipment 设备管理
     * @return 结果
     */
    @Override
    public int insertFzEquipment(FzEquipment fzEquipment)
    {
        fzEquipment.setCreateTime(DateUtils.getNowDate());
        return fzEquipmentMapper.insertFzEquipment(fzEquipment);
    }

    /**
     * 修改设备管理
     * 
     * @param fzEquipment 设备管理
     * @return 结果
     */
    @Override
    public int updateFzEquipment(FzEquipment fzEquipment)
    {
        fzEquipment.setUpdateTime(DateUtils.getNowDate());
        return fzEquipmentMapper.updateFzEquipment(fzEquipment);
    }

    /**
     * 删除设备管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFzEquipmentByIds(String ids)
    {
        return fzEquipmentMapper.deleteFzEquipmentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除设备管理信息
     * 
     * @param equipmentId 设备管理ID
     * @return 结果
     */
    @Override
    public int deleteFzEquipmentById(String equipmentId)
    {
        return fzEquipmentMapper.deleteFzEquipmentById(equipmentId);
    }
}
